#include <bits/stdc++.h>
using namespace std;
const int N = 100+10;
double d[N];
int w[N];
int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> w[i];
    }

    d[n] = w[n];
    for (int i = n-1; i >=1; --i) {
        int j = i+6>n? n-i:6;
        for (int k = 1; k <= j; ++k) {
            d[i] += d[i+k];
        }
        d[i] /= j;
        d[i] += w[i];
    }


    cout << setprecision(7) << fixed << d[1];
    return 0;
}